package cn.wolfcode.rbac.web.controller;

import cn.wolfcode.rbac.service.IEmployeeService;
import cn.wolfcode.rbac.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
public class LoginController {
//    //验证用户名和密码
//    @Autowired
//    private IEmployeeService employeeService;
//    @RequestMapping("/login")
//    @ResponseBody
//    public JsonResult login(String username, String password){
//        JsonResult json = new JsonResult();
//        try {
//            employeeService.login(username,password);
//            return json;
//        }catch (Exception e){
//            e.printStackTrace();
//            json.mark(e.getMessage());
//        }
//        return json;
//    }
//    @RequestMapping("/logout")
//    public String logout(HttpSession session){
//        session.invalidate();
//        return "redirect:/login.html";
//    }
}
